﻿<Window x:Class="WpfWordsLearner.Views.LearnView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:conv="clr-namespace:WpfWordsLearner.Converters"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:mvvm="clr-namespace:Catel.Windows.Interactivity;assembly=Catel.MVVM"
        Title="Learn window"
        Width="480"
        Height="250"
        WindowStyle="ToolWindow">
	<i:Interaction.Triggers>
		<i:EventTrigger EventName="Closing">
			<mvvm:EventToCommand Command="{Binding ClosingWinCommand}" PassEventArgsToCommand="True" />
		</i:EventTrigger>
	</i:Interaction.Triggers>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="30" />
			<RowDefinition />
			<RowDefinition />
			<RowDefinition />
			<RowDefinition Height="30" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="100" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal">
			<TextBlock VerticalAlignment="Center" Text="Choose words count to learn:" />
			<ComboBox Width="45"
			          Margin="4,0,0,0"
			          ItemsSource="{Binding Path=WordsCount}"
			          SelectedIndex="0"
			          SelectedItem="{Binding Path=SelectedCount}" />
			<TextBlock Margin="3,0,0,0"
			           VerticalAlignment="Center"
			           Text="Interval(ms):" />
			<ComboBox Width="60"
			          Margin="4,0,0,0"
			          ItemsSource="{Binding Path=Intervals}"
			          SelectedIndex="0"
			          SelectedItem="{Binding Path=Interval}" />
			<CheckBox Content="Only complicated"
			          Foreground="Blue"
			          IsChecked="{Binding OnlyComplicated,
			                              Mode=TwoWay}" />
		</StackPanel>

		<TextBlock Grid.Row="1"
		           VerticalAlignment="Center"
		           Text="Word:" />
		<TextBlock Grid.Row="2"
		           VerticalAlignment="Center"
		           Text="Translation:" />
		<TextBox Grid.Row="1"
		         Grid.Column="1"
		         VerticalAlignment="Center"
		         IsReadOnly="True"
		         Text="{Binding WordToLearn.Word}" />
		<TextBox Grid.Row="2"
		         Grid.Column="1"
		         VerticalAlignment="Center"
		         IsReadOnly="True"
		         Text="{Binding WordToLearn.Translate}" />
		<StackPanel Grid.Row="3"
		            Grid.ColumnSpan="2"
		            HorizontalAlignment="Center"
		            VerticalAlignment="Center"
		            Orientation="Horizontal">
			<Button Width="80"
			        Height="30"
			        Command="{Binding BeginLearnCommand}"
			        Content="Begin"
			        IsEnabled="{Binding EnableButton}" />

			<Button Width="80"
			        Height="30"
			        Margin="3,0,0,0"
			        Command="{Binding CloseWindow}"
			        Content="Begin test"
			        IsEnabled="{Binding Completed}" />
		</StackPanel>
		<StatusBar Grid.Row="4" Grid.ColumnSpan="2">
			<StatusBarItem>
				<TextBlock Text="{Binding Remain, StringFormat='Remain {0} words'}" />
			</StatusBarItem>
			<StatusBarItem HorizontalAlignment="Right">
				<CheckBox Content="Use voice"
				          Foreground="Blue"
				          IsChecked="{Binding UseVoice}" />
			</StatusBarItem>
		</StatusBar>
	</Grid>
</Window>
